package day04;

import java.util.Random;
import java.util.Scanner;

public class GuessDemo {
    public static void main(String[] args) {
     //   int guess=260;
    //    int num=(int)(Math.random()*1000+1);
      //  System.out.println(num);
        Random ran=new Random();
        Scanner sc=new Scanner(System.in);
      //  ran.setSeed(1000);
       int guess=ran.nextInt(1000);
       int num;
        System.out.println("请输入您要猜的数");
       do{
           num=sc.nextInt();
           if(num>guess){
               System.out.println("猜大了");
           }else if(num<guess){
               System.out.println("猜小了");
           }else {
               System.out.println("猜对了");
           }

       }while (guess!=num);

    }
}
